package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	file, err := os.Open("./xx.txt")
	if err != nil {
		fmt.Println("open file failed, err：", err)
		return
	}
	defer file.Close()
	scanner := bufio.NewScanner(file) // // MaxScanTokenSize = 64 * 1024
	for scanner.Scan() {
		fmt.Println(scanner.Text())
	}
	if err := scanner.Err(); err != nil {
		fmt.Println("read file failed, err:", err)
	}
}
